#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/ip.h>
#include <netinet/ip_icmp.h>
#include <netdb.h>
#include <errno.h>
#include <fcntl.h>

// constants
#define PACKET_SIZE		70
#define ICMP_SIZE		4
#define SOCKET_TIMEOUT	10
#define MAX_STEPS		30
#define PROBE_MAX_CON	10

#define IP_ADDR_SIZE	16
#define HOST_NAME_SIZE	50

#define PROBE_FILE_NAME "probes.txt"
#define PROBE_DEFAULT_PORT "30001"

#define TRUE 1
#define FALSE 0

#define DEBUG_MODE	FALSE

// types
struct node {
	char *addr;
	char *host_name;
	int port;
	int socket;
	struct node *next;
};

struct probe_args {
	char addr[16];
};

struct result {
	char ip_addr[17];
	char host_name[HOST_NAME_SIZE];
};

struct probe_result {
	int error;
	int	num_hosts;
	struct result res[MAX_STEPS];
};

// final tree

struct cons_tree {
	char ip_addr[23];

	struct cons_tree *children;
	struct cons_tree *siblings;
};

extern int errno;


